// 模拟 lodash curry


function getNum(a, b, c) { 
  return a + b +c
}

const curried = curry(getNum)

console.log(curried(1, 2, 3)) // 6


console.log(curried(1)(2, 3)) // 6

console.log(curried(1, 2)(3)) // 6


function curry(func) { 
  return function curried (...args) { 
    // 判断实参和形参的个数 
    if (args.length < func.length) { 
      return function () {
        return curried(...args.concat(Array.from(arguments)))
      }
    }
    return func(...args)
  }
}